package com.arina.onepagesmarthome;

public class MasterBoard {
	public String CurrentAddress;
	private String LocalAddress;
	private String InternetAddress;
	public int ControlPort;//port nhan lenh dieu khien tu ben ngoai
	public int ResponsePort;//port gui tra lenh ra he thong ben ngoai
	public SYSTEM_TYPE SytemType;
	public MasterBoard(SYSTEM_TYPE sytemType,String localAddress, String internetAddress,
			int controlPort, int responsePort) {
		super();
		SytemType=sytemType;
		LocalAddress = localAddress;
		InternetAddress = internetAddress;
		ControlPort = controlPort;
		ResponsePort = responsePort;
		CurrentAddress=localAddress;
		
	}
	
	public void setCurrentAddress(NETWORK_STATUS networkstatus)
	{
		if(networkstatus==NETWORK_STATUS.LOCAL)
			CurrentAddress=LocalAddress;
		else if(networkstatus==NETWORK_STATUS.EXTERNAL||networkstatus==NETWORK_STATUS.MOBILE)
			CurrentAddress=InternetAddress;
		else//not connect
			CurrentAddress=null;
	}
}
